package string;
//将变量转换为字符串类型
public class ValueOfDemo {
    public static void main(String[] args) {
        int a = 100;
        String str = String.valueOf(a);
       // System.out.println(String.valueOf(a));
        System.out.println(str);

        double b = 3.123;
        String str1 = String.valueOf(b);
        System.out.println(str1);

        String s3 =""+b;//任何类型与字符串相连，结果都会变为字符串类型，效率低
        System.out.println(s3);
    }
}
